\section{Continuous state model}
\label{continuousStateModel}
This section clarifies how the bomber-battleship problem can be realized for a discrete time, continuous state model. In this model the ship moves in the plane with a certain velocity. The bomber drops the bomb at any point and hits 
anything within a certain radius, but the bomb still takes some time units to explode.

\subsection{Random/curve ship and observing bomber}
The first idea is to implement a ship which moves randomly or according to a certain function through the plane. 
The bomber chooses the place to bomb corresponding to the observations of the ship's movements before (like the discrete observing bomber of section \ref{ObservingBomber}). 

\label{RandomShipAndObservingBomber}
\label{Continuous1}
\paragraph{Random ship}
One implemented strategy for the ship is to move randomly through the plane. To simulate a kind of realistic movement, it is 
only able to change its current direction between $-45^\circ$ to $45^\circ$ (see figure \ref{shipMovement}). Furthermore, the ship can increase or decrease its current velocity by a random number between $0$ and $1$, bounded by the maximum velocity. Hence, it can reach any point in the area between $-45^\circ$ to $45^\circ$, with the maximum velocity as radius.
Figure \ref{RandomShipsMovement} shows an example of how the random ship could move in 500 time steps. 

\begin{figure}[h]
\begin{center}
\resizebox{4.5cm}{!}{
 \includegraphics{Bilder/ShipsMovementContinous}}
\caption{Restricted random ship in continuous state model}
\label{shipMovement}
\end{center}
\end{figure}

\begin{figure}[h]
\begin{center}
\resizebox{8cm}{!}{
 \includegraphics{Bilder/shipSimple}}
\caption{Random ship in continuous state model - example movement}
\label{RandomShipsMovement}
\end{center}
\end{figure}


\paragraph{Curve ship}
The second strategy the ship can use is to move like the following function:
\begin{equation}
\begin{aligned}
y_t=\frac{x_{t-1}^4}{510^4}*v-y_{t-1}-\epsilon\\
 x_t=v^2-y_t^2 
\end{aligned}
\end{equation}


with $x_t$ and $y_t$ describing the coordinates at time $t$, $v$ as the constant velocity and $\epsilon$ as normal distributed noise. 
The movement of the ship is shown on figure \ref{curveShip}. 

\begin{figure}
\begin{center}
\resizebox{8cm}{!}{
 \includegraphics{Bilder/shipCurve.png}}
\caption{Movement curve ship}
\label{curveShip}
\end{center}
\end{figure}
 

\paragraph{Observing bomber}
The bomber follows the ships movements and drops the bomb, depending on its observations. 
The idea is to calculate for every observation the change in angle and the change in velocity of the movements of the ship. To predict the position of the ship when the bomb explodes the bomber uses these values in two different ways:
\begin{itemize}
 \item it uses the \textbf{average values} (unweighted bomber)
 \item it uses the \textbf{weighted average values}, where the last movements are weighted stronger than the movements  farther back (weighted bomber)
\end{itemize}

For instance, if the bomber observes the following values which are sorted from last observed to first observed:
\begin{itemize}
\item Change in angle: ${30,-15,23}$
\item Change in velocity: ${0.5,-0.2,0.9}$
\end{itemize}
Then the unweighted bomber would calculate the average:
\begin{itemize}
\item Change in angle =  $\frac{30 + -15 + 23}{3} = 12.67$
\item Change in velocity =  $\frac{0.5 + -0.2 + 0.9}{3} = 0.40$
\end{itemize}
While the weighted bomber would calculate the following weighted average:
\begin{itemize}
\item Change in angle =  $\frac{3*30 + 2*-15 + 1*23}{6} = 13.83$
\item Change in velocity =  $\frac{3*0.5 + 2*-0.2 + 1*0.9}{6} = 0.33$
\end{itemize}

\subsection{Hidden Markov model}
\label{HMCChapter}
Another way to simulate the continuous case is to convert it into a hidden Markov model. 
For this part it is assumed that the ship moves with the constant velocity $1$.

\begin{figure}[h]
\begin{center}
\resizebox{7.5cm}{!}{
 \includegraphics{Bilder/HiddenMarkovChain}}
 \caption{Continuous state model as hidden Markov model}
\label{HMC}
\end{center}
\end{figure}
\paragraph{Hidden Markov model - ship}
The ship moves like it is shown on figure \ref{HMC}. There are the three states \textit{Left, Middle} and \textit{Right}, with the corresponding transition probabilities to move from one state to another. 
It can be seen, that it is not possible to change between the states \textit{Left} and \textit{Right} directly. 
The emissions \textit{E1,E2} and \textit{E3} stand for the different angle ranges, inside which the ship moves: $-45^\circ$ to $-15^\circ$ (E1), $-15^\circ$ to $15^\circ$ (E2) and $15^\circ$ to $45^\circ$ (E3). Depending on the state, the emissions have different probabilities. \cite{Sheldon}

The figure \ref{HMShip} shows an example of the movement of the Markov ship.
\begin{figure}[h]
\begin{center}
\resizebox{8cm}{!}{
 \includegraphics{Bilder/shipMarkov}}
 \caption{Markov ship - example movement}
\label{HMShip}
\end{center}
\end{figure}

\paragraph{Hidden Markov model - bomber}
The bomber only knows that there are three different states. It observes the ship and classifies the observed angles to the corresponding 
emission \textit{E1, E2} or \textit{E3}. 
The bomber uses the observed sequence of emissions for the \textit{Baum-Welch algorithm}, an algorithm to find  
the hidden Markov model and its associated transition and emission probabilities. \cite{ViterbiBaumWelch} 
These estimated probabilities are necessary for the \textit{Viterbi algorithm} to detect the most likely current state of the ship.  \cite{Viterbi}  

Given the estimated hidden Markov model and its transition and emission probabilities and the current assumed state of the ship, 
the bomber is able to simulate the ship to decide where it will be 
when the bomb explodes. 
Figure \ref{HMCBomber} shows that a hit radius of $\sin{\frac{\pi}{12}}\approx 0.25882$ and a ship with constant speed 1 ensure that a bomb dropped 
in the middle of the emission range, covers all the possible places for this emission if the time lag is $1$. \cite{Beyer} For our tests we used this radius for the two-move lag.
\begin{figure}[h]
\begin{center}
\resizebox{5.5cm}{!}{
 \includegraphics{Bilder/BomberHMC}}
 \caption{Bomber in the hidden Markov model}
\label{HMCBomber}
\end{center}
\end{figure}

